package com.bpzj.util.excel;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class ExportDateToExcel {

  public static void main(String[] args) throws IOException {
    XSSFWorkbook workbook = new XSSFWorkbook();

    XSSFSheet sheet = workbook.createSheet();
    XSSFRow row = sheet.createRow(0);
    XSSFCell cell = row.createCell(1);
    cell.setCellValue("hello");

    try (OutputStream stream = new FileOutputStream("1.xlsx"); ) {
      workbook.write(stream);
    }
  }
}
